export const pngBase64ToFile = (base64Data: string, fileName: string) => {
  // 从Base64数据中提取图像部分
  const base64Image = base64Data.split(',')[1];

  // 解码Base64数据
  const binaryData = atob(base64Image);

  // 创建一个Uint8Array
  const uint8Array = new Uint8Array(binaryData.length);
  for (var i = 0; i < binaryData.length; i++) {
    uint8Array[i] = binaryData.charCodeAt(i);
  }
  // 创建Blob对象
  const blob = new Blob([uint8Array], { type: 'image/png' });
  // 创建File对象
  const file = new File([blob], fileName, { type: 'image/png' });
  return file
};
